package cn.leida.ruoyi.common.core.domain.entity;

import cn.leida.ruoyi.common.annotation.Excel;
import cn.leida.ruoyi.common.core.domain.BaseEntity;
import jakarta.persistence.*;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.Data;


/**
 * 字典数据表 sys_dict_data
 *
 * @author liutietou
 * @since 1.0  2020-12-11
 */
@Data
@Entity
@Table(name = "sys_dict_data")
public class SysDictData extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 字典编码
     */
    @Excel(name = "字典编码", cellType = Excel.ColumnType.NUMERIC)
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "dict_code")
    private Long dictCode;

    /**
     * 字典排序
     */
    @Excel(name = "字典排序", cellType = Excel.ColumnType.NUMERIC)
    @Column(name = "dict_sort")
    private Long dictSort;

    /**
     * 字典标签
     */
    @NotBlank(message = "字典标签不能为空")
    @Size(min = 0, max = 100, message = "字典标签长度不能超过100个字符")
    @Excel(name = "字典标签")
    @Column(name = "dict_label",length = 100)
    private String dictLabel;

    /**
     * 字典键值
     */
    @Excel(name = "字典键值")
    @NotBlank(message = "字典键值不能为空")
    @Size(min = 0, max = 100, message = "字典键值长度不能超过100个字符")
    @Column(name = "dict_value",length = 100)
    private String dictValue;

    /**
     * 字典类型
     */
    @Excel(name = "字典类型")
    @NotBlank(message = "字典类型不能为空")
    @Size(min = 0, max = 100, message = "字典类型长度不能超过100个字符")
    @Column(name = "dict_type",length = 100)
    private String dictType;

    /**
     * 样式属性（其他样式扩展）
     */
    @Size(min = 0, max = 100, message = "样式属性长度不能超过100个字符")
    @Column(name = "css_class",length = 100)
    private String cssClass;

    /**
     * 表格字典样式
     */
    @Column(name = "list_class",length = 100)
    private String listClass;

    /**
     * 是否默认（Y是 N否）
     */
    @Column(name = "is_default",length = 10)
    private String isDefault;

    /**
     * 状态（0正常 1停用）
     */
    @Column(name = "status",length = 10)
    private String status;

    /**
     * 创建者
     */
    @Column(name = "create_by",length = 64)
    private String createBy;

    /**
     *
     * 创建时间
     */
    @Column(name = "create_time",length = 30)
    private String createTime;

    /**
     * 更新者
     */
    @Column(name = "update_by",length = 64)
    private String updateBy;

    /**
     * 更新时间
     */
    @Column(name = "update_time",length = 30)
    private String updateTime;


    /**
     * 备注
     */
    @Column(name = "remark",length = 500)
    private String remark;

    public void initUpdateTime() {
        updateTime = nowTime();
    }

    public void initCreateTime() {
        createTime = nowTime();
    }
}
